import { createRouter, createWebHistory } from 'vue-router'
import request from '@/util/request.js'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path:"/login",
      name:"登录",
      component:()=>import("@/views/Login.vue")
    },
    {
      path:"/",
      name:"main",
      component:()=>import("@/components/Layout.vue"),
      redirect:"/list",
      children:[
        {
          path:'list',
          name:"对话列表",
          component:()=>import("@/views/ContactList.vue")
        },
        {
          path:'profile',
          name:'我的',
          component:()=>import("@/views/Profile.vue")
        }
      ]
    },
    {
      path:"/chat",
      name:"聊天",
      component:()=>import("@/views/Chat.vue")
    }
  ],
})

export default router
